# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.VectorTile.V1.Model.TerrainTile do
  @moduledoc """
  A tile containing information about the terrain located in the region it covers.

  ## Attributes

  *   `coordinates` (*type:* `GoogleApi.VectorTile.V1.Model.TileCoordinates.t`, *default:* `nil`) - The global tile coordinates that uniquely identify this tile.
  *   `firstDerivative` (*type:* `GoogleApi.VectorTile.V1.Model.FirstDerivativeElevationGrid.t`, *default:* `nil`) - Terrain elevation data encoded as a FirstDerivativeElevationGrid. cs/symbol:FirstDerivativeElevationGrid.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Resource name of the tile. The tile resource name is prefixed by its collection ID `terrain/` followed by the resource ID, which encodes the tile's global x and y coordinates and zoom level as `@,,z`. For example, `terrain/@1,2,3z`.
  *   `secondDerivative` (*type:* `GoogleApi.VectorTile.V1.Model.SecondDerivativeElevationGrid.t`, *default:* `nil`) - Terrain elevation data encoded as a SecondDerivativeElevationGrid. cs/symbol:SecondDerivativeElevationGrid. See go/byte-encoded-terrain for more details.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :coordinates => GoogleApi.VectorTile.V1.Model.TileCoordinates.t() | nil,
          :firstDerivative =>
            GoogleApi.VectorTile.V1.Model.FirstDerivativeElevationGrid.t() | nil,
          :name => String.t() | nil,
          :secondDerivative =>
            GoogleApi.VectorTile.V1.Model.SecondDerivativeElevationGrid.t() | nil
        }

  field(:coordinates, as: GoogleApi.VectorTile.V1.Model.TileCoordinates)
  field(:firstDerivative, as: GoogleApi.VectorTile.V1.Model.FirstDerivativeElevationGrid)
  field(:name)
  field(:secondDerivative, as: GoogleApi.VectorTile.V1.Model.SecondDerivativeElevationGrid)
end

defimpl Poison.Decoder, for: GoogleApi.VectorTile.V1.Model.TerrainTile do
  def decode(value, options) do
    GoogleApi.VectorTile.V1.Model.TerrainTile.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.VectorTile.V1.Model.TerrainTile do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
